
import Vue from "vue"
import store from '@/store'

export default function isHasButton() {
    Vue.directive('has', {
        inserted: function (el, binding, vnode) {
            let buttons = store.state.user.buttons
            if (buttons.indexOf(binding.value) === -1) {
                el.parentNode.removeChild(el)
            }
        }
    })
}
